package com.fstec.ks.master.bean;

import java.util.Date;
import java.util.concurrent.ConcurrentHashMap;

import com.fstec.ks.master.vo.RoomRoundVO;

public class RoomRoundHolder {
	private String key;
	private Date beginTime;
	private Date endTime;
	// key:roomId+examServerId
	private ConcurrentHashMap<String, RoomRoundVO> roomRoundRef=new ConcurrentHashMap<String, RoomRoundVO>();
	
	public RoomRoundHolder(String key, Date roundBeginTime, Date roundEndTime) {
		this.key=key;
		this.beginTime=roundBeginTime;
		this.endTime=roundEndTime;
	}

	public String getKey() {
		return key;
	}

	public Date getBeginTime() {
		return beginTime;
	}

	public Date getEndTime() {
		return endTime;
	}

	public void addRoomRound(RoomRoundVO roomRoundVO) {
		this.roomRoundRef.put(roomRoundVO.getRoomId()+roomRoundVO.getExamServerId(), roomRoundVO);
	}
	
	public RoomRoundVO getRoomRound(String examServerId, String roomId){
		return this.roomRoundRef.get(roomId+examServerId);
	}
}
